<?php
defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
class Admin_model extends CI_Model {
	public function __construct() {
		parent::__construct ();
	}
	/*
	 * 根据用户名和密码来得到管理员账号
	*/
	public function get_admin($username, $password) {
		$query = $this->db->get_where ( 't_admin', array (
				'username' => $username,
				'password' => $password 
		) );
		if ($query->num_rows () > 0) {
			return $query->row_array();
		}
		return array();
	}
}